﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using canthovieclam.BL.Models;
using canthovieclam.DAL;
using canthovieclam.DAL.Repositories;
namespace canthovieclam.BL
{
    public class LocationImpl
    {
        public List<LocationModel> GetLocationModelList()
        {
            var locationRepository = new LocationRepository();
            List<LocationModel> listLocationModel = (from x in locationRepository.GetAllLocation()
                                                     select new LocationModel(x)).ToList();
            return listLocationModel;
        }

        public LocationModel GetLocationModel(int locationId)
        {
            var locationRepository = new LocationRepository();
            var location = locationRepository.GetSingleLocation(k => k.LocationId == locationId);
            var locationModel = new LocationModel(location);     

            return locationModel;
        }
    }
}
